﻿using System;
using System.Linq;

namespace LinqTutorial
{
    class Program
    {
        static void Main(string[] args)
        {
            var oAWDataCtx = new AdventureWorksDataContext();

            var query = from p in oAWDataCtx.Products
                        select new { ID = p.ProductID, p.Name, Price = p.ListPrice };

            foreach (var product in query)
            {
                Console.WriteLine(string.Format("{0} | {1} | {2}",
                                                product.ID, product.Name, product.Price));
            }
            Console.ReadLine();
        }
    }
}